package homework;

import java.util.Scanner;

public class number4 {
public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	System.out.println("请输入一串字符串：");
	String inputstr = sc.next();
	
	char[] arraystr = inputstr.toCharArray();
	for(char c: arraystr) {
		if(Character.isUpperCase(c)) {
			 char changec = (char) ((c - 'A' + 1) % 26 + 'a');
			 System.out.print(changec);
		}
		else if (Character.isLowerCase(c)) {
			char changec1 = change(c);
			System.out.print(changec1);
		}
		else {
			System.out.print(c);
		}
	}
}
public static char change(char c) {
	switch (c) {
	case 'a':case'b':case'c':
		return '2';
	case 'd':case'e':case'f':
		return '3';
	case 'g':case'h':case'i':
		return '4';
	case 'j':case'k':case'l':
		return '5';
	case 'm':case'n':case'o':
		return '6';
	case 'p':case'q':case'r':case's':
		return '7';
	case 't':case'u':case'v':
		return '8';
	case 'w':case'x':case'y':case'z':
		return '9';
	case '0':
		return '0';

	default:
		return c;
	}
	
}
}
